import http from "@/utils/request";
// 用户登录
function loginReq(loginname,password){
    return http({
        method:"post",
        url:"/api/user/login",
        data:{loginname,password}
    })
}
// 用户注册
function regReq(loginname,password){
    return http({
        method:"post",
        url:"/api/user/reg",
        data:{loginname,password}
    })
}
// 获取用户信息
function getUserInfoReq(userid){
    return http({
        method:"get",
        url:"/api/user/info",
        params:{userid}
    })
}
// 修改用户昵称
function bindUserNameReq(userid,username){
    return http({
        method:"get",
        url:"/api/user/bindusername",
        params:{userid,username}
    })
}
// 修改用户密码
function updateUserPasswordReq(userid,oldpassword,newpassword){
    return http({
        method:"post",
        url:"/api/user/updatePassword",
        data:{userid,oldpassword,newpassword}
    })
}
export{loginReq,regReq,getUserInfoReq,bindUserNameReq,updateUserPasswordReq}